home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 1 (Walnut Creek)
/
Aminet - June 1993 [Walnut Creek].iso
/
aminet
/
os20
/
cdity
/
huntwin7.lha
/
huntwindows.s
< prev
Wrap
Text File
|
1993-04-26
|
41KB
|
1,981 lines
output work:huntwindows
OPT o+,ow-
;no includes - i use them all preassembled!
;.... nearly all ....
incdir "sys:devpac/include/"
include "workbench/startup.i"
include "workbench/workbench.i"
include "workbench/icon_lib.i"
include "libraries/commodities.i"
include "graphics/view.i"
;TODO:
;Hotkey for GUI
;BUGS:
;SOMETIMES... there is a guru at closedown
;Some helpful macros
CALL macro
jsr _LVO\1(a6)
endm
Push macro
movem.l \1,-(sp)
endm
Pull macro
movem.l (sp)+,\1
endm
RSave macro
movem.l a0-a6/d0-d7,-(sp)
endm
RLoad macro
movem.l (sp)+,a0-a6/d0-d7
endm
MaxScreens equ 64 ;Maximum of 64 Screens - who has more?
ScreenMemSize equ MaxScreens*8
;Bits for Communication
SignalWindow equ 0
SignalScreen equ 1
SignalButton equ 2
MyHotkeyID = 1
MyCustomID = 2
RSave
move.l $04,a6
move.l #AllocLength,d0
move.l #MEMF_CLEAR,d1
CALL AllocMem
move.l d0,a4
tst.l d0
beq EndeRaus
move.l d0,RememberA4
move.l a7,RememberStack
lea intuition(pc),a1
moveq.l #37,d0
CALL OpenLibrary
move.l d0,IntBase(a4)
beq Error2
lea DosName(pc),a1
moveq.l #37,d0
CALL OpenLibrary
move.l d0,DosBase(a4)
beq Error2
lea GadName(pc),a1
moveq.l #37,d0
CALL OpenLibrary
move.l d0,GadBase(a4)
beq Error2
lea CommName(pc),a1
moveq.l #37,d0
CALL OpenLibrary
move.l d0,CommBase(a4)
beq Error2
CALL CreateMsgPort
move.l d0,MouseMsgPort(a4)
beq Error2
move.l #SIGBREAKF_CTRL_C,SignalMask(a4)
move.l d0,a0
move.l #IOSTD_SIZE,d0
CALL CreateIORequest
move.l d0,MyIORequest(a4)
beq Error2
lea InputName(pc),a0
moveq.l #0,d0
move.l MyIORequest(a4),a1
moveq.l #0,d1
CALL OpenDevice
tst.l d0
bne Error2
lea IconName(pc),a1
moveq.l #33,d0
CALL OpenLibrary
move.l d0,IconBase(a4)
beq Error2
move.l ThisTask(a6),a1
move.l a1,OwnTask(a4)
tst.l pr_CLI(a1)
bne CliStart
lea pr_MsgPort(a1),a2
move.l a2,a0
CALL WaitPort
move.l a2,a0
CALL GetMsg
move.l d0,WBMessage(a4)
move.l d0,a3
move.l sm_ArgList(a3),d7
beq DisableSave
move.l d7,a0
move.l wa_Lock(a0),d1
move.l DosBase(a4),a6
CALL CurrentDir
move.l IconBase(a4),a6
move.l d7,a0
move.l wa_Name(a0),a0
CALL GetDiskObject
move.l d0,DObject(a4)
beq Error2
lea WBTemplate(pc),a3
move.l d0,a0
move.l do_ToolTypes(a0),a0
GetEmLoop tst.l (a3)
beq.s FreeDobj
move.l TemplateText(a3),a1
beq.s FreeDobj
move.l a0,-(sp)
CALL FindToolType
move.l (sp)+,a0
sub.l a2,a2
move.w TemplateA4(a3),a2
add.l a4,a2
move.l d0,(a2)
add.l #TemplateSize,a3
bra.s GetEmLoop
FreeDobj bsr BuildPatterns
bra.s SkipReadArgs
CliStart move.l DosBase(a4),a6
move.l #Template,d1
lea TemplateArray(a4),a0
move.l a0,d2
moveq.l #0,d3
CALL ReadArgs ;Get options
tst.l d0
beq Error2
move.l d0,Args(a4)
bsr BuildPatterns
DisableSave move.l #1,TempSave(a4)
SkipReadArgs move.l $04,a6
lea GraphicsName(pc),a1
moveq.l #36,d0
CALL OpenLibrary
move.l d0,GraphicsBase(a4)
beq Error2
tst.l TempHADJ(a4)
beq GotIt1
move.l TempHADJ(a4),a0
bsr GetNexta0
clr.l TempHADJ(a4)
cmp.b #"l",d0
beq.s GotIt1
add.l #1,TempHADJ(a4)
cmp.b #"r",d0
beq.s GotIt1
add.l #1,TempHADJ(a4)
cmp.b #"c",d0
beq.s GotIt1
add.l #1,TempHADJ(a4)
GotIt1 tst.l TempVADJ(a4)
beq GotIt2
move.l TempVADJ(a4),a0
bsr GetNexta0
clr.l TempVADJ(a4)
cmp.b #"t",d0
beq.s GotIt2
add.l #1,TempVADJ(a4)
cmp.b #"b",d0
beq.s GotIt2
add.l #1,TempVADJ(a4)
cmp.b #"c",d0
beq.s GotIt2
add.l #1,TempVADJ(a4)
GotIt2 tst.l TempCXPRI(a4)
beq.s GotIt3
move.l TempCXPRI(a4),a0
bsr GetNexta0
bsr GetInteger
move.l d0,TempCXPRI(a4)
move.b d0,MyPri
GotIt3 move.l $04,a6
CALL CreateMsgPort
move.l d0,BrokerPort
move.l d0,MyPort(a4)
move.l d0,a0
move.b MP_SIGBIT(a0),d0
move.l SignalMask(a4),d1 ;Enter signal into
bset d0,d1 ;mask for waiting
move.l d1,SignalMask(a4)
move.l CommBase(a4),a6
lea MyNewBroker(pc),a0
clr.l d0
CALL CxBroker
tst.l d0
beq QuitPrg
move.l d0,Broker(a4)
move.l d0,a0
moveq.l #1,d0
CALL ActivateCxObj
;Install Handler for Mouse_Button_test
move.l #CX_CUSTOM,d0
lea TestButton(pc),a0 ;My Program
move.l #MyCustomID,a1 ;ID
CALL CreateCxObj
move.l d0,a1
tst.l d0
beq QuitPrg
move.l Broker(a4),a0
CALL AttachCxObj
bsr InstallHotKey
move.l $04,a6
moveq #-1,d0 ;A Signal for telling
jsr _LVOAllocSignal(a6) ;our task that sth happened
tst.l d0
bmi Error2
move.l d0,Signal(a4)
move.l SignalMask(a4),d1
bset d0,d1
move.l d1,SignalMask(a4)
lea MyInterrupt(a4),a1
move.l #Interrupt3,IS_CODE(a1)
clr.l IS_DATA(a1)
move.b #NT_INTERRUPT,LN_TYPE(a1)
move.b #0,LN_PRI(a1)
move.l #HandlerName,LN_NAME(a1)
move.l #5,d0 ;INTB_VERTB
jsr _LVOAddIntServer(a6)
tst.l TempCXPOPUP(a4)
beq.s WaitOn
bsr OpenGUI
WaitOn tst.w QuitMe(a4)
bne QuitPrg
move.l $04,a6
move.l SignalMask(a4),d0 ;Wait for Port and Break
CALL Wait
btst #SIGBREAKB_CTRL_C,d0 ;This means quit
bne QuitPrg
move.l Signal(a4),d1
btst d1,d0 ;Signal from Interrupt?
beq.s TryNextMsg
tst.w DisableHW(a4)
bne.s TryNextMsg ;Do nothing
tst.w ButtonPressed(a4)
bne.s TryNextMsg ;Omit that stuff for now
bclr #SignalButton,What(a4) ;We will get a signal when
;the button will be released
move.l IntBase(a4),a0
btst #SignalWindow,What(a4)
beq.s NoWindowStuff
move.l ib_ActiveWindow(a0),a0
bsr DoYourJob
bclr #SignalWindow,What(a4)
NoWindowStuff btst #SignalScreen,What(a4)
beq.s TryNextMsg
move.l IntBase(a4),a0
move.l ib_FirstScreen(a0),a0
bsr AdjustScreen
bclr #SignalScreen,What(a4)
TryNextMsg move.l MyPort(a4),a0 ;Get the message awaiting
CALL GetMsg
tst.l d0
bne.s GotMsg
bsr CheckGUI
bra WaitOn
GotMsg move.l d0,a3
move.l d0,a0
move.l CommBase(a4),a6
CALL CxMsgType
move.l d0,d6
move.l a3,a0
CALL CxMsgID
move.l d0,d5
move.l a3,a1
move.l $04,a6
CALL ReplyMsg
cmp.w #CXM_IEVENT,d6
bne.s OtherCommand
bsr OpenGUI
OtherCommand cmp.w #CXM_COMMAND,d6
bne WaitOn
cmp.w #CXCMD_DISABLE,d5
bne.s OtherI1
move.w #1,DisableHW(a4)
OtherI1 cmp.w #CXCMD_ENABLE,d5
bne.s OtherI2
clr.w DisableHW(a4)
OtherI2 cmp.w #CXCMD_UNIQUE,d5
beq.s OtherII
cmp.w #CXCMD_APPEAR,d5
bne.s OtherI3
OtherII bsr OpenGUI
OtherI3 cmp.w #CXCMD_DISAPPEAR,d5
bne.s OtherI4
bsr CloseGUI
OtherI4 cmp.w #CXCMD_KILL,d5
beq QuitPrg
bra TryNextMsg
Error2 lea Text1(pc),a0 ;Seems there is an error
bsr OpenRequester ;in the given arguments
bra.s QuitPrg
EndeRaus2 lea Text2(pc),a0 ;Wrong Kickstart
bsr PrintText
QuitPrg move.l RememberStack,a7
bsr CloseGUI
move.l $04,a6
move.l #5,d0
lea MyInterrupt(a4),a1
tst.l IS_CODE(a1)
beq.s NoHandler
CALL RemIntServer ;Remove the Interrupt-Server
NoHandler tst.l MyIORequest(a4)
beq.s NoDevIO
move.l MyIORequest(a4),a1
CALL CloseDevice
move.l MyIORequest(a4),a0
CALL DeleteIORequest
NoDevIO tst.l MouseMsgPort(a4)
beq.s NoMouseMsg
move.l MouseMsgPort(a4),a0
bsr CloseMsgPort
NoMouseMsg move.l IconBase(a4),a6
tst.l DObject(a4)
beq.s SkipFreeDobj
move.l DObject(a4),a0
CALL FreeDiskObject
SkipFreeDobj move.l $04,a6
move.l Signal(a4),d0 ;Free the signal
beq.s DontFreeS
CALL FreeSignal
DontFreeS tst.l Args(a4)
beq.s HmmNoArgs
move.l DosBase(a4),a6
move.l Args(a4),d1
CALL FreeArgs
HmmNoArgs bsr RemovePopKey
tst.l Broker(a4)
beq.s NoCX
move.l CommBase(a4),a6
move.l Broker(a4),a0
CALL DeleteCxObjAll
NoCX move.l $04,a6
tst.l MyPort(a4)
beq.s NoPort
move.l MyPort(a4),a0
bsr CloseMsgPort
NoPort move.l IntBase(a4),d0 ;Close librarys
beq.s ErrorX2
move.l d0,a1
CALL CloseLibrary
ErrorX2 move.l GraphicsBase(a4),d0
beq.s ErrorX1
move.l d0,a1
CALL CloseLibrary
ErrorX1 move.l IconBase(a4),d0
beq.s NoIconLib
move.l d0,a1
CALL CloseLibrary
NoIconLib move.l CommBase(a4),d0
beq.s NoCommLib
move.l d0,a1
CALL CloseLibrary
NoCommLib move.l GadBase(a4),d0
beq.s OnlyDOS
move.l d0,a1
CALL CloseLibrary
OnlyDOS move.l DosBase(a4),d0
beq.s FreeOnly
move.l d0,a1
CALL CloseLibrary
FreeOnly move.l ScreenPatLen(a4),d0
beq.s NoScreenPat
move.l ScreenPattern(a4),a1
CALL FreeMem
NoScreenPat move.l WindowPatLen(a4),d0
beq.s NoWindowPat
move.l WindowPattern(a4),a1
CALL FreeMem
NoWindowPat move.l WBMessage(a4),d7
move.l a4,a1
move.l #AllocLength,d0
CALL FreeMem
move.l d7,a1
tst.l d7
beq.s EndeRaus
CALL Forbid
CALL ReplyMsg
EndeRaus RLoad
moveq.l #0,d0
rts
CloseMsgPort move.l a0,a3
ClosePortRout move.l a3,a0
CALL GetMsg
tst.l d0
beq.s NoMsgLeft
move.l d0,a1
CALL ReplyMsg
bra.s ClosePortRout
NoMsgLeft move.l a3,a0
CALL DeleteMsgPort ;and free it
rts
;Subroutine to print a text to stdout
PrintText Push d0-d4/a0-a1/a6
move.l a0,a1
moveq.l #0,d0
TestLen tst.b (a1)+
beq.s LaengeOk
addq #1,d0
bra.s TestLen
LaengeOk move.l $04,a6
lea DosName(pc),a1
moveq.l #0,d0
CALL OpenLibrary
move.l d0,DosBase(a4)
beq SkipWrite
move.l d0,a6
move.l a0,d2
move.l d0,d3
CALL Output
move.l d0,d1
beq.s SkipWrite
CALL Write
SkipWrite Pull d0-d4/a0-a1/a6
rts
;MainPart: does the scrolling if necessary
;Gets window in a0
DoYourJob RSave
move.l a0,d0 ;No Window - let it be!
beq LeaveIt
move.l a0,a5
move.l wd_WScreen(a5),a3
move.l DosBase(a4),a6
tst.b ScreenPatternMem(a4)
beq.s NoMatter2
move.l ScreenPattern(a4),d1
move.l sc_DefaultTitle(a3),d2
CALL MatchPatternNoCase
beq LeaveIt
NoMatter2 tst.b WindowPatternMem(a4)
beq.s NoMatter3
move.l WindowPattern(a4),d1
move.l wd_Title(a5),d2
CALL MatchPatternNoCase
beq LeaveIt
NoMatter3 move.l a3,a0
move.l a5,d0
bsr RememberWindow
NoInterest move.l a0,d0 ;Screen not valid? - let it be!
beq LeaveIt
NoMatter move.l GraphicsBase(a4),a6 ;Get the visible size
lea sc_ViewPort(a3),a0 ;of the screen to
move.l vp_ColorMap(a0),a0
;lea VideoConTags,a1
move.l cm_vpe(a0),a0 ;extra
;CALL VideoControl
;tst.l d0
;bne LeaveIt
;lea (ViewPortExt+vpe_DisplayClip)(pc),a0
lea vpe_DisplayClip(a0),a0 ;extra
;REMARK: Due to an error in OS3 I cannot use the system-friendly way which would be:
; -Decomment all comments above
; -Decomment the TagList at Label ";VideoConTags"
; -Decomment the Structure at Label ";ViewPortExt"
; -Comment the lines with the comment ";extra"
move.w ra_MaxX(a0),d0
sub.w ra_MinX(a0),d0
addq #1,d0
move.w d0,VisualX(a4)
move.w sc_LeftEdge(a3),d0
sub.w ra_MinX(a0),d0
move.w d0,PositionX(a4)
move.w ra_MaxY(a0),d0
sub.w ra_MinY(a0),d0
addq #1,d0
move.w d0,VisualY(a4)
move.w sc_TopEdge(a3),d0
sub.w ra_MinY(a0),d0
move.w d0,PositionY(a4)
move.l a3,a0
move.l IntBase(a4),a6
tst.l TempSFront(a4) ;do we want screentofront?
beq.s NoFront
cmp.l ib_FirstScreen(a6),a0
beq.s NoFront ;Not necessary (optimize!)
CALL ScreenToFront
bset #SignalScreen,What(a4) ;ScreenChange!
NoFront move.l wd_Flags(a5),d0
and.l #WFLG_BACKDROP,d0
bne LeaveIt ;Not with backdrops!
tst.l TempWFront(a4) ;do we WindowToFront() ?
beq.s NoFront2
move.l a5,a0
CALL WindowToFront
NoFront2 tst.l TempMove(a4)
beq LeaveIt
move.l wd_WScreen(a5),a0
moveq.l #0,d7
moveq.l #0,d6
moveq.l #0,d0
moveq.l #0,d2
move.w wd_LeftEdge(a5),d0
add.w wd_Width(a5),d0
move.w PositionX(a4),d2
neg.w d2
add.w VisualX(a4),d2
sub.w d0,d2
beq.s SeemsOk2
bpl.s SeemsOk
move.w d2,d7 ;MOVEX!
ext.l d7
SeemsOk move.w wd_LeftEdge(a5),d0
move.w PositionX(a4),d2
neg.w d2
sub.w d2,d0
bne.s TestAgain
moveq.l #0,d7
TestAgain bpl.s SeemsOk2
move.w d0,d7 ;MOVEX! - Prefer Leftedge
ext.l d7
neg.l d7
SeemsOk2 move.w wd_TopEdge(a5),d0
move.w PositionY(a4),d2
neg.w d2
sub.w d2,d0
beq.s SeemsOk4
bpl.s SeemsOk3
move.w d0,d6
ext.l d6 ;MOVEY!
neg.l d6
SeemsOk3 move.w wd_TopEdge(a5),d0
add.w wd_Height(a5),d0
move.w PositionY(a4),d2
neg.w d2
add.w VisualY(a4),d2
sub.w d0,d2
bne.s TestAgain2
moveq.l #0,d6
TestAgain2 bpl.s SeemsOk4
move.w d2,d6 ;MOVEY! - Prefer bottom
ext.l d6
SeemsOk4 tst.l TempAlways(a4)
bne.s DOOO
tst.l d7
bne.s DOOO
tst.l d6
beq LeaveIt
DOOO move.l d7,d0
tst.l TempAlways(a4)
bne.s DoAlways1
tst.l d0
beq.s NoMoveAny1
DoAlways1 cmp.l #2,TempHADJ(a4)
bne.s NoCentering1
moveq.l #0,d0
move.w wd_Width(a5),d0
lsr.w #1,d0
add.w wd_LeftEdge(a5),d0
moveq.l #0,d2
move.w VisualX(a4),d2
lsr.w #1,d2
move.w PositionX(a4),d3
neg.w d3
add.w d3,d2
sub.w d0,d2
move.l d2,d0
ext.l d0
bra NoMoveAny1
NoCentering1 tst.l TempHADJ(a4)
bne.s RightAdj
moveq.l #0,d0
move.w wd_LeftEdge(a5),d0
add.w PositionX(a4),d0
neg.w d0
ext.l d0
bra.s NoMoveAny1
RightAdj cmp.l #1,TempHADJ(a4)
bne.s NoMoveAny1
move.w wd_LeftEdge(a5),d0
add.w wd_Width(a5),d0
move.w PositionX(a4),d2
neg.w d2
add.w VisualX(a4),d2
sub.w d0,d2
move.l d2,d0
ext.l d0
NoMoveAny1 move.l d6,d1
tst.l TempAlways(a4)
bne.s DoAlways2
tst.l d1
beq.s NoMoveAny2
DoAlways2 cmp.l #2,TempVADJ(a4)
bne.s NoCentering2
moveq.l #0,d1
move.w wd_Height(a5),d1
lsr.w #1,d1
add.w wd_TopEdge(a5),d1
moveq.l #0,d2
move.w VisualY(a4),d2
lsr.w #1,d2
move.w PositionY(a4),d3
neg.w d3
add.w d3,d2
sub.w d1,d2
move.l d2,d1
ext.l d1
bra NoMoveAny2
NoCentering2 tst.l TempVADJ(a4)
bne.s BotAdj
moveq.l #0,d1
move.w wd_TopEdge(a5),d1
add.w PositionY(a4),d1
neg.w d1
ext.l d1
bra.s NoMoveAny2
BotAdj cmp.l #1,TempVADJ(a4)
bne.s NoMoveAny2
move.w wd_TopEdge(a5),d1
add.w wd_Height(a5),d1
move.w PositionY(a4),d2
neg.w d2
add.w VisualY(a4),d2
sub.w d1,d2
move.l d2,d1
ext.l d1
NoMoveAny2 move.w sc_TopEdge(a0),d5
move.w sc_LeftEdge(a0),d6
RSave
CALL MoveScreen
RLoad
sub.w sc_TopEdge(a0),d5 ;Find out how far the
sub.w sc_LeftEdge(a0),d6 ;screen really moves
move.l d6,d0
move.l d5,d1
neg.l d0
neg.l d1
tst.l TempMoveMouse(a4)
beq.s LeaveIt
;If a window becomes active without clicking, the Mouse
;can be out of range, and moving it would scroll the
;Screen back, so we check this here and disable movement
;if "dangerous"
move.w sc_MouseX(a0),d2
add.w sc_LeftEdge(a0),d2
add.w d0,d2 ;Movement in X
bmi.s ClearXMovement
cmp.w VisualX(a4),d2
bcs.s LeaveXMovement
ClearXMovement moveq.l #0,d0
LeaveXMovement move.w sc_MouseY(a0),d2
add.w sc_TopEdge(a0),d2
add.w d1,d2 ;Movement in Y
bmi.s ClearYMovement
cmp.w VisualY(a4),d2
bcs.s LeaveYMoveMent
ClearYMovement moveq.l #0,d1
LeaveYMoveMent bsr SetPointer
LeaveIt RLoad
rts
;ScreenID in a0
AdjustScreen RSave
move.l a0,a3
tst.b ScreenPatternMem(a4)
beq.s NoMatter5
move.l ScreenPattern(a4),d1
move.l sc_DefaultTitle(a3),d2
move.l DosBase(a4),a6
CALL MatchPatternNoCase
beq SkipActive
move.l a3,a0
NoMatter5 tst.l TempPDef(a4) ;Enter FirstScreen as Default
;PublicScreen ?
beq.s Skip_NoPub
bsr GetPubFromID
move.l a0,d0
beq.s Skip_NoPub
move.l IntBase(a4),a6
CALL SetDefaultPubScreen
Skip_NoPub move.l a3,a0
tst.l TempRemWin(a4) ;Activate a Window on the new
;Screen?
beq.s SkipActive
bsr GetScreenWindow
tst.l d0
bne.s FoundActive
move.l sc_FirstWindow(a0),d0 ;Take Firstwindow if none
beq.s SkipActive ;known
FoundActive move.l d0,a5
tst.b WindowPatternMem(a4)
beq.s NoMatter4
move.l WindowPattern(a4),d1
move.l wd_Title(a5),d2
move.l DosBase(a4),a6
CALL MatchPatternNoCase
beq SkipActive
NoMatter4 move.l a5,a0
move.l IntBase(a4),a6
CALL ActivateWindow
SkipActive RLoad
rts
;a0=Screen Back:d0=Window
GetScreenWindow Push a1/d1
lea ScreenMem(a4),a1
move.w #MaxScreens-1,d1
ScreenFindLoop cmp.l (a1),a0
beq.s FoundScreen
lea 8(a1),a1
dbf d1,ScreenFindLoop
FoundScreen move.l 4(a1),d0
bsr TestWindowOnScreen
Pull a1/d1
rts
;a0=Screen d0=Window
RememberWindow Push a1-a3/a6/d1
move.l IntBase(a4),a6
lea ScreenMem(a4),a1
move.w #MaxScreens-1,d1
ScreenFindLoop2 tst.l (a1)
beq.s FoundEmpty
move.l (a1),a2
cmp.l a0,a2
beq.s FoundEmpty ;because Identical
move.l ib_FirstScreen(a6),a3
CheckAllScreens cmp.l a3,a2
beq ScreenValid
move.l sc_NextScreen(a3),a3
cmp.l #0,a3
bne.s CheckAllScreens
bra.s FoundEmpty ;because Entry is invalid
ScreenValid lea 8(a1),a1
dbf d1,ScreenFindLoop2
;Reaching this Point our List is full of valid
;Screens - not the best thing, but we simply ignore...
bra.s IgnoreOver
FoundEmpty move.l a0,(a1)
move.l d0,4(a1)
IgnoreOver Pull a1-a3/a6/d1
rts
;d0=Window , a0=Screen =Back: d0=0 no window
TestWindowOnScreen tst.l d0
beq.s NotWindow
move.l sc_FirstWindow(a0),a1
WindowListOn cmp.l d0,a1
beq.s WindowIsOK
move.l wd_NextWindow(a1),a1
cmp.l #0,a1
bne.s WindowListOn
NotWindow clr.l d0
rts
WindowIsOK move.l a1,d0
rts
;ScreenID in a0 ;Return a0=PubScreenName or Zero
GetPubFromID Push d0/a3/a6
move.l a0,a3
move.l IntBase(a4),a6
CALL LockPubScreenList
CarryListOn move.l d0,a0
cmp.l psn_Screen(a0),a3
beq.s ScreenFound
move.l LN_SUCC(a0),d0
bne.s CarryListOn
sub.l a0,a0
bra.s ENDPS
ScreenFound move.l LN_NAME(a0),a0
ENDPS move.l a0,-(sp)
CALL UnlockPubScreenList
move.l (sp)+,a0
Pull d0/a3/a6
rts
Interrupt3 Push d1-d4/a0-a1/a3/a4/a6
move.l RememberA4,a4
move.l IntBase(a4),a3
move.l Active(a4),d0
cmp.l ib_ActiveWindow(a3),d0 ;New ActiveWindow?
beq.s DoScreen
move.l ib_ActiveWindow(a3),Active(a4)
bsr SignalMyself
bset #SignalWindow,What(a4)
DoScreen move.l FirstSc(a4),d0
cmp.l ib_FirstScreen(a3),d0 ;New FirstScreen?
beq.s DoNothing
move.l ib_FirstScreen(a3),FirstSc(a4)
bsr SignalMyself
bset #SignalScreen,What(a4)
DoNothing Pull d1-d4/a0-a1/a3/a4/a6
moveq.l #0,d0
rts
SignalMyself move.l $04,a6
move.l OwnTask(a4),a1
move.l Signal(a4),d1 ;send a signal to move Screen
moveq.l #0,d0
bset d1,d0
jmp _LVOSignal(a6)
OpenGUI RSave
tst.w GUIOpened(a4)
bne OpenNoGUI
move.l IntBase(a4),a6
sub.l a0,a0
CALL LockPubScreen
move.l d0,PublicScreen(a4)
move.l d0,StorePublicScreen
move.l d0,a0
lea sc_RastPort(a0),a1
move.l a1,PublicRastport(a4)
lea TagListDone(pc),a1
move.l GadBase(a4),a6
CALL GetVisualInfoA
move.l d0,MyVisual(a4)
lea MyNewGadget(a4),a3
move.l d0,gng_VisualInfo(a3)
lea GadgetList(a4),a0
CALL CreateContext
move.l d0,Gadget0(a4)
move.l GraphicsBase(a4),a6
move.l PublicRastport(a4),a1
lea GUI_Text5(pc),a0
moveq.l #GUI_Text6-GUI_Text5-1,d0
CALL TextLength
add.w #40,d0 ;CheckBox
lsr.w #1,d0
move.w d0,RemLen(a4)
moveq.l #1,d0
add.w RemLen(a4),d0
lsl.l #2,d0
move.l d0,StoreInnerWidth
move.l PublicScreen(a4),a0
moveq.l #6,d0
add.b sc_WBorLeft(a0),d0
move.w d0,RemLeft(a4)
move.l sc_Font(a0),a1
move.l a1,gng_TextAttr(a3)
moveq.l #1,d0
add.b sc_WBorTop(a0),d0 ;Base (Top)
move.w d0,RemTop(a4)
move.w ta_YSize(a1),d6
add.w #4,d6 ;Height of One Line
move.w d6,RemHeight(a4)
add.w #2,d6
mulu #10,d6
add.w #8,d6
move.l d6,StoreInnerHeight
move.l Gadget0(a4),d7
bsr DoAllGadgets
move.l d7,LastGadget(a4)
sub.l a0,a0
lea WindowTagList(pc),a1
move.l IntBase(a4),a6
CALL OpenWindowTagList
move.l d0,MyWindow(a4)
beq FailWindow
move.l d0,a0
bsr EnterSignal
;move.l d0,a0
move.l GadgetList(a4),a1
moveq.l #-1,d0
moveq.l #-1,d1
sub.l a2,a2
CALL AddGList
move.l GadgetList(a4),a0
move.l MyWindow(a4),a1
moveq.l #-1,d0
sub.l a2,a2
CALL RefreshGList
move.l GadBase(a4),a6
move.l MyWindow(a4),a0
sub.l a1,a1
CALL GT_RefreshWindow
move.w #1,GUIOpened(a4)
RLoad
rts
OpenNoGUI move.l IntBase(a4),a6
move.l MyWindow(a4),a0
CALL ActivateWindow
RLoad
rts
rsreset
MyGadgetText rs.l 1
MyGadgetList rs.l 1
MyGadgetRowNr rs.b 1
MyGadgetXPos rs.b 1
MyGadgetWidth rs.b 1
MyGadgetFlags rs.b 1
MyGadgetStore rs.w 1
MyGadgetKind rs.w 1
MyGadgetSize rs.w 1
; gng_Flags ,gng_Text ,CreateKind ,CreateTags
; gng_TopEdge ,gng_LeftEdge
AllGadgets dc.l GUI_Text8,CycleTagList
dc.b 1,2,2,PLACETEXT_LEFT
dc.w TempHADJ,CYCLE_KIND
dc.l GUI_Text9,CycleTagList2
dc.b 2,2,2,PLACETEXT_LEFT
dc.w TempVADJ,CYCLE_KIND
dc.l GUI_Text16,StringTagList
dc.b 5,2,2,PLACETEXT_LEFT
dc.w TempCXPOPKEY,STRING_KIND
dc.l GUI_Text12,StringTagList
dc.b 3,2,2,PLACETEXT_LEFT
dc.w TempScreen,STRING_KIND
dc.l GUI_Text13,StringTagList
dc.b 4,2,2,PLACETEXT_LEFT
dc.w TempWindow,STRING_KIND
dc.l GUI_Text1,GadgetTagList
dc.b 6,0,2,PLACETEXT_RIGHT
dc.w TempMove,CHECKBOX_KIND
dc.l GUI_Text2,GadgetTagList
dc.b 6,2,2,PLACETEXT_RIGHT
dc.w TempSFront,CHECKBOX_KIND
dc.l GUI_Text3,GadgetTagList
dc.b 7,0,2,PLACETEXT_RIGHT
dc.w TempWFront,CHECKBOX_KIND
dc.l GUI_Text5,GadgetTagList
dc.b 7,2,2,PLACETEXT_RIGHT
dc.w TempPDef,CHECKBOX_KIND
dc.l GUI_Text6,GadgetTagList
dc.b 8,0,2,PLACETEXT_RIGHT
dc.w TempAlways,CHECKBOX_KIND
dc.l GUI_Text7,GadgetTagList
dc.b 8,2,2,PLACETEXT_RIGHT
dc.w TempRemWin,CHECKBOX_KIND
dc.l GUI_Text7_1,GadgetTagList
dc.b 9,0,2,PLACETEXT_RIGHT
dc.w TempMoveMouse,CHECKBOX_KIND
dc.l GUI_Text7_2,GadgetTagList
dc.b 9,2,2,PLACETEXT_RIGHT
dc.w TempCXPOPUP,CHECKBOX_KIND
dc.l GUI_Text10,TagList
dc.b 10,0,1,PLACETEXT_IN
dc.w TempZero,BUTTON_KIND
dc.l GUI_Text11,TagList
dc.b 10,3,1,PLACETEXT_IN
dc.w TempZero,BUTTON_KIND
SaveGadgData dc.l GUI_Text14,TagList
dc.b 10,1,1,PLACETEXT_IN
dc.w TempSave,BUTTON_KIND
dc.l GUI_Text15,TagList
dc.b 10,2,1,PLACETEXT_IN
dc.w TempZero,BUTTON_KIND
dc.l -1
;a3:Pointer to the GadgetStructure
;d7:Previous Gadget
DoAllGadgets lea AllGadgets(pc),a5
move.l GadBase(a4),a6
moveq.l #1,d6
DoAllGadgets2 tst.l (a5)
bmi.s WasLastGadget
moveq.l #0,d0
move.b MyGadgetRowNr(a5),d0
move.w RemHeight(a4),d1
addq.w #2,d1
mulu d1,d0
add.w RemTop(a4),d0 ;Top
move.w d0,gng_TopEdge(a3)
moveq.l #0,d0
move.b MyGadgetXPos(a5),d0
mulu RemLen(a4),d0
add.w RemLeft(a4),d0
move.w d0,gng_LeftEdge(a3)
moveq.l #0,d0
move.b MyGadgetWidth(a5),d0
mulu RemLen(a4),d0
sub.w #8,d0
move.w d0,gng_Width(a3)
move.w RemHeight(a4),gng_Height(a3)
moveq.l #0,d0
move.b MyGadgetFlags(a5),d0
move.l d0,gng_Flags(a3)
add.w #1,gng_GadgetID(a3)
move.l MyGadgetText(a5),gng_GadgetText(a3)
move.w d6,gng_GadgetID(a3)
sub.l a2,a2
move.w MyGadgetStore(a5),a2
add.l a4,a2
move.l (a2),d4
moveq.l #0,d0
move.w MyGadgetKind(a5),d0
move.l d7,a0 ;Previous Gadget
move.l a3,a1
move.l MyGadgetList(a5),a2
move.l d4,4(a2)
CALL CreateGadgetA
move.l d0,d7 ;Remember Previous Gadget
add.l #MyGadgetSize,a5
addq.l #1,d6
bra.s DoAllGadgets2
WasLastGadget rts
CheckGUI RSave
tst.w GUIOpened(a4)
beq NoGUI
move.l GadBase(a4),a6
move.l MyWindow(a4),a0
move.l wd_UserPort(a0),a0
CALL GT_GetIMsg
tst.l d0
beq NoGUI
move.l d0,a1
moveq.l #0,d6
move.w im_Code(a1),d6 ;Value of Gadget
move.l im_IAddress(a1),a2
move.l im_Class(a1),d7
CALL GT_ReplyIMsg
cmp.l #GADGETUP,d7
bne Others
move.w gg_GadgetID(a2),d0
move.l gg_SpecialInfo(a2),a3
cmp.w #14,d0
beq HideGad
cmp.w #15,d0
beq QuitGad
cmp.w #16,d0
beq SaveGad
cmp.w #17,d0
beq AboutGad
subq.l #1,d0
lea AllGadgets(pc),a5
mulu #MyGadgetSize,d0
sub.l a2,a2
move.w MyGadgetStore(a5,d0.w),a2
add.l a4,a2
cmp.w #STRING_KIND,MyGadgetKind(a5,d0.w)
bne.s CheckBoxTest
move.l si_Buffer(a3),a0
move.l (a2),a1
bsr CopyPattern
bsr BuildPatterns
bsr InstallHotKey
bra.s NoGUI
CheckBoxTest cmp.w #CHECKBOX_KIND,MyGadgetKind(a5,d0.w)
bne.s StandardGUI
;using im_Code works only since V39, so:
moveq.l #1,d6
tst.l (a2)
beq.s StandardGUI
moveq.l #0,d6
StandardGUI move.l d6,(a2)
bra.s NoGUI
SaveGad bsr SaveConfig
bra.s NoGUI
AboutGad lea AboutText(pc),a0
bsr OpenRequester
bra.s NoGUI
QuitGad bsr CloseGUI
move.w #1,QuitMe(a4)
bra.s HideGad
Others cmp.l #CLOSEWINDOW,d7
bne.s NoClose
HideGad bsr CloseGUI
bra.s NoGUI
NoClose cmp.l #IDCMP_VANILLAKEY,d7
bne.s NoGUI
cmp.b #"q",d6
beq.s QuitGad
cmp.b #"a",d6
beq.s AboutGad
cmp.b #"s",d6
beq.s SaveGad
cmp.b #"h",d6
beq.s HideGad
NoGUI RLoad
rts
CloseGUI RSave
tst.w GUIOpened(a4)
beq.s NotOpened
move.l IntBase(a4),a6
move.l MyWindow(a4),a0
bsr RemoveSignal
;move.l MyWindow(a4),a0
move.l GadgetList(a4),a1
moveq.l #-1,d0
CALL RemoveGList
move.l MyWindow(a4),a0
clr.l d0
move.w wd_TopEdge(a0),d0
move.l d0,RemWindowY
move.w wd_LeftEdge(a0),d0
move.l d0,RemWindowX
CALL CloseWindow
FailWindow move.l GadgetList(a4),a0
move.l GadBase(a4),a6
CALL FreeGadgets
move.l MyVisual(a4),a0
CALL FreeVisualInfo
move.l IntBase(a4),a6
sub.l a0,a0
move.l PublicScreen(a4),a1
CALL UnlockPubScreen
NotOpened clr.w GUIOpened(a4)
RLoad
rts
EnterSignal Push d0-d1/a0
move.l wd_UserPort(a0),a0
move.b MP_SIGBIT(a0),d0
move.l SignalMask(a4),d1
bset d0,d1
move.l d1,SignalMask(a4)
Pull d0-d1/a0
rts
RemoveSignal Push d0-d1/a0
move.l wd_UserPort(a0),a0
move.b MP_SIGBIT(a0),d0
move.l SignalMask(a4),d1
bclr d0,d1
move.l d1,SignalMask(a4)
Pull d0-d1/a0
rts
GetNexta0.1 tst.b (a0)+
GetNexta0 move.b (a0),d0
cmp.b #"=",d0
beq.s GetNexta0.1
cmp.b #" ",d0
beq.s GetNexta0.1
or.w #$20,d0
rts
;Screen in a0, X-Coord(rel) in d0, Y-Coord(rel) in d1
SetPointer Push a0-a2/d0-d1/a6
lea PointerPixEvent(a4),a2
move.l a0,iepp_Screen(a2)
move.w sc_LeftEdge(a0),d2
add.w sc_MouseX(a0),d2
move.w sc_TopEdge(a0),d3
add.w sc_MouseY(a0),d3
move.l MyIORequest(a4),a1
move.w #IND_WRITEEVENT,io_Command(a1)
lea MyInputEvent(a4),a0
move.l #0,ie_NextEvent(a0)
move.b #IECLASS_POINTERPOS,ie_Class(a0)
move.w #0,ie_Qualifier(a0)
add.w d0,d2
add.w d1,d3
move.w d2,ie_X(a0)
move.w d3,ie_Y(a0)
move.b #IESUBCLASS_PIXEL,ie_SubClass(a0)
move.w #IECODE_NOBUTTON,ie_Code(a0)
move.l a0,io_Data(a1)
move.l #ie_SIZEOF,io_Length(a1)
move.l $04,a6
CALL DoIO
Pull a0-a2/a6/d0-d1
rts
BuildPatterns RSave
tst.l TempScreen(a4)
beq.s NoScreenPattern
move.l TempScreen(a4),a0
bsr GetNexta0
lea ScreenPatternMem(a4),a1
bsr CopyPattern
lea ScreenPatternMem(a4),a0
lea ScreenPatLen(a4),a2
lea ScreenPattern(a4),a3
bsr GetLen
bpl NoScreenPattern
bsr PatternError
NoScreenPattern lea ScreenPatternMem(a4),a0
move.l a0,TempScreen(a4)
tst.l TempWindow(a4)
beq.s NoWindowPattern
move.l TempWindow(a4),a0
bsr GetNexta0
lea WindowPatternMem(a4),a1
bsr CopyPattern
lea WindowPatternMem(a4),a0
lea WindowPatLen(a4),a2
lea WindowPattern(a4),a3
bsr GetLen
bpl.s NoWindowPattern
bsr PatternError
NoWindowPattern lea WindowPatternMem(a4),a0
move.l a0,TempWindow(a4)
RLoad
rts
PatternError lea Text3(pc),a0
bra OpenRequester
;a0:Source, a1:Dest
CopyPattern move.w #511,d0
CopyPattern2 move.b (a0)+,(a1)+
beq.s EndCopy
dbf d0,CopyPattern2
bsr PatternError
EndCopy rts
;In: (a2): LEN - (a3): MEMORY - a0: Source-Pattern :back: d0=pattern ok?
GetLen move.l a0,d6
clr.l d3
GetLen2 tst.b (a0)+
beq.s EndOfString
addq.l #1,d3
bra.s GetLen2
EndOfString lsl.w #1,d3 ;StandardLen Of Pattern
addq #2,d3
move.l $04,a6
tst.l (a3)
beq AllocNew
move.l (a3),a1
move.l (a2),d0
CALL FreeMem
clr.l (a3)
AllocNew move.l d3,(a2)
move.l d3,d0
move.l #MEMF_CLEAR,d1
CALL AllocMem
move.l d0,d2
beq QuitPrg ;No Memory? Good bye !
move.l d0,(a3)
move.l d6,d1
move.l DosBase(a4),a6
CALL ParsePatternNoCase
rts
;a0: Requester-Text
OpenRequester Push a0-a3
lea EasyReqStruct(a4),a1
lea PortName(pc),a2
move.l a2,es_Title(a1)
move.l a0,es_TextFormat(a1)
lea GadgetText(pc),a2
move.l a2,es_GadgetFormat(a1)
move.l IntBase(a4),a6
sub.l a0,a0
;a1: EasyReq
sub.l a2,a2
sub.l a3,a3
CALL EasyRequestArgs
Pull a0-a3
rts
SaveConfig RSave
tst.l WBMessage(a4)
beq SkipConfig
move.l WBMessage(a4),a3
move.l sm_ArgList(a3),d0
beq SkipConfig
move.l d0,a0
move.l wa_Name(a0),a0
move.l a0,d5
move.l DObject(a4),d0
beq SkipConfig
move.l d0,a0
move.l do_ToolTypes(a0),a5 ;Remember Old
move.l #1,TempDummy(a4)
Push a0/a6
move.l $04,a6
move.l #NumberOfTemps*10+2*512+2*8,d0 ;Memory for tool arrays
move.l #MEMF_CLEAR,d1
CALL AllocMem
move.l d0,a3
beq MemErrTool
move.l DObject(a4),a0
move.l d0,do_ToolTypes(a0)
move.l d0,a1
add.l #(NumberOfTemps+1)*4,a1 ;Maximum Number of Pointers
clr.l d7
lea WBTemplate(pc),a2
LoopAllTemps sub.l a0,a0
move.w TemplateA4(a2),a0
add.l a4,a0
move.l (a0),d6
beq.s IsDefault
move.l a1,(a3,d7)
move.l TemplateText(a2),a0
bsr CopyPattern
move.w TemplateType(a2),d1
beq ThatsAllTemp
move.b #"=",-1(a1)
cmp.w #T_CYCLE,d1
bne.s ThatsString
move.l TemplateSpecial(a2),a0
lsl.l #2,d6
move.l (a0,d6.w),a0
bsr CopyPattern
bra.s ThatsAllTemp
ThatsString cmp.w #T_STRING,d1
bne.s ThatsInteger
move.l d6,a0
bsr CopyPattern
bra.s ThatsAllTemp
ThatsInteger move.l d6,d0
bsr PrintInteger
ThatsAllTemp addq.l #4,d7
move.l a1,d0
and.l #$ffffffc,d0
move.l d0,a1
lea 4(a1),a1 ;Align on Longwords
IsDefault add.l #TemplateSize,a2
tst.l TemplateText(a2)
bne LoopAllTemps
move.l d5,a0
move.l DObject(a4),a1
move.l IconBase(a4),a6
CALL PutDiskObject
bne.s Done
lea Text4(pc),a0
bsr OpenRequester
Done move.l $04,a6
move.l #NumberOfTemps*10+2*512+2*8,d0
move.l a3,a1
CALL FreeMem
MemErrTool Pull a0/a6
move.l a5,do_ToolTypes(a0)
bra.s DoneConfig
SkipConfig lea Text4(pc),a0
bsr OpenRequester
DoneConfig RLoad
rts
;Where in hell has this damned OS a atoi and itoa function???
;Quick implementation of word-only functions:
;a0:String Back: d0: Integer
GetInteger Push d1-d2/a0
moveq.l #0,d0
moveq.l #0,d1
moveq.l #1,d2
cmp.b #"-",(a0)
bne.s GetDezNr
tst.b (a0)+
moveq.l #-1,d2
GetDezNr move.b (a0)+,d1
cmp.b #"0",d1
bcs StringOver
cmp.b #"9"+1,d1
bcc StringOver
sub.w #$30,d1
mulu #$0a,d0
add.l d1,d0
bra.s GetDezNr
StringOver muls d2,d0
Pull d1-d2/a0
rts
;d0: Integer a1:String
PrintInteger tst.l d0
bpl.s PrDez0
move.b #"-",(a1)+
neg.l d0
PrDez0 move.w #-1,-(sp)
PrDez divu #$0a,d0
swap d0
move.w d0,-(sp)
clr.w d0
swap d0
bne.s PrDez
PrDez1 move.w (sp)+,d0
bmi.s CloseUp
add.w #"0",d0
move.b d0,(a1)+
bra.s PrDez1
CloseUp clr.b (a1)+
rts
InstallHotKey Push a0-a1/a6
InstallHotKey2 lea DefaultDescr(pc),a0
lea Description(a4),a1
tst.l TempCXPOPKEY(a4)
beq.s NoPOPKEY
move.l TempCXPOPKEY(a4),a0
bsr GetNexta0
NoPOPKEY move.l a1,TempCXPOPKEY(a4)
bsr CopyKey
bmi.s HotKeyError
bsr RemovePopKey
lea Description(a4),a0
move.l MyPort(a4),a1
move.l #MyHotkeyID,d0 ;ID... I only got one Key to manage
bsr HotKey
bmi HotKeyError
move.l a0,Filter(a4)
CALL CxObjError
bne.s DeleteAndErr
move.l Filter(a4),a1
move.l Broker(a4),a0
CALL AttachCxObj
Pull a0-a1/a6
rts
DeleteAndErr bsr DeletePopKey
HotKeyError lea HotKeyErrorT(pc),a0
bsr OpenRequester
clr.l TempCXPOPKEY(a4)
bra.s InstallHotKey2
CopyKey move.w #63,d0
CopyString move.b (a0)+,(a1)+
beq.s EndString
dbf d0,CopyString
moveq.l #-1,d0
EndString rts
RemovePopKey move.l CommBase(a4),a6
tst.l Filter(a4)
beq.s NoFilter
move.l Filter(a4),a0
CALL RemoveCxObj
DeletePopKey move.l Filter(a4),a0
CALL DeleteCxObjAll
clr.l Filter(a4)
NoFilter rts
;Implementation of the cx.lib function
;HotKey(char *Description,MsgPort *CxPort,long Event)
;a0=Description, a1=CxPort, d0=Event ;Back: d0:Error, a0:Filter
HotKey Push d1-d7/a1-a2/a6
move.l a1,a2 ;Rem Port
move.l d0,d6 ;Rem Event
move.l CommBase(a4),a6
move.l #CX_FILTER,d0
;Description is in a0
sub.l a1,a1
CALL CreateCxObj
move.l d0,d7 ;Remember Filter
beq.s HKErr2
move.l #CX_SEND,d0
move.l a2,a0 ;Given Port
move.l d6,a1 ;Event
CALL CreateCxObj
move.l d0,d6 ;Remember Sender
beq.s HKErr
move.l d7,a0 ;Filter
move.l d6,a1 ;Sender
CALL AttachCxObj
move.l #CX_TRANSLATE,d0
sub.l a0,a0
move.l a0,a1
CALL CreateCxObj
move.l d0,a1
tst.l d0
beq.s HKErr
move.l d6,a0 ;Sender
;Translate is in a1
CALL AttachCxObj
move.l d7,a0 ;Return Filter in a0
moveq.l #0,d0
bra.s HKOut
HKErr move.l Filter(a4),a0
CALL DeleteCxObjAll
HKErr2
lea GadgetText(pc),a0
bsr OpenRequester
moveq.l #-1,d0
HKOut Pull d1-d7/a1-a2/a6
rts
TestButton RSave
cmp.l #0,a0
beq.s SkipTestButton
move.l RememberA4,a4
move.l CommBase(a4),a6
CALL CxMsgData
tst.l d0
beq SkipTestButton
move.l d0,a0
cmp.b #IECLASS_RAWMOUSE,ie_Class(a0)
bne.s SkipTestButton
cmp.w #IECODE_UP_PREFIX!IECODE_LBUTTON,ie_Code(a0)
beq.s RelButton
cmp.w #IECODE_LBUTTON,ie_Code(a0)
bne.s SkipTestButton
move.w #1,ButtonPressed(a4)
bra.s SkipTestButton
RelButton clr.w ButtonPressed(a4)
bsr SignalMyself
bset #SignalButton,What(a4)
SkipTestButton RLoad
rts
BLINK RSave
move.w #$10,d1
blink2 move.w #$7fff,d0
blink1 move.w d0,$dff180
dbf d0,blink1
dbf d1,blink2
RLoad
rts
StringTagList dc.l GTST_String
dc.l 0
dc.l GTST_MaxChars
dc.l 511
dc.l TAG_DONE
CycleTagList dc.l GTCY_Active
dc.l 0
dc.l GTCY_Labels
dc.l CycleList
dc.l TAG_DONE
CycleTagList2 dc.l GTCY_Active
dc.l 0
dc.l GTCY_Labels
dc.l CycleList2
dc.l TAG_DONE
GadgetTagList dc.l GTCB_Checked
dc.l 0
dc.l TAG_DONE
TagList dc.l GA_Disabled
dc.l 0
dc.l GT_Underscore
dc.l '_'
TagListDone dc.l TAG_DONE
WindowTagList dc.l WA_InnerWidth
StoreInnerWidth dc.l 0
dc.l WA_InnerHeight
StoreInnerHeight dc.l 0
dc.l WA_IDCMP
dc.l BUTTONIDCMP!CLOSEWINDOW!IDCMP_VANILLAKEY
dc.l WA_Flags
dc.l WINDOWCLOSE!WINDOWDRAG!WINDOWDEPTH!ACTIVATE
dc.l WA_PubScreen
StorePublicScreen dc.l 0
dc.l WA_Title
dc.l Texth
dc.l WA_AutoAdjust
dc.l 1
dc.l WA_Left
RemWindowX dc.l -1
dc.l WA_Top
RemWindowY dc.l -1
dc.l TAG_DONE
;VideoConTags dc.l VTAG_VIEWPORTEXTRA_GET
; dc.l ViewPortExt
; dc.l TAG_DONE
;ViewPortExt ds.b vpe_SIZEOF
RememberA4 dc.l 0
RememberStack dc.l 0
rsreset
ScreenPatLen rs.l 1
ScreenPattern rs.l 1
WindowPatLen rs.l 1
WindowPattern rs.l 1
GadgetList rs.l 1
PositionX rs.w 1
PositionY rs.w 1
What rs.w 1
DisableHW rs.w 1
GUIOpened rs.w 1
QuitMe rs.w 1
RemFontSize rs.w 1
ButtonPressed rs.w 1
GadgetInside rs.w 11
MyPort rs.l 1
MyVisual rs.l 1
Broker rs.l 1
ScreenMem rs.b ScreenMemSize
IntBase rs.l 1
RemLen rs.w 1
RemHeight rs.w 1
RemTop rs.w 1
RemLeft rs.w 1
GadBase rs.l 1
DosBase rs.l 1
CommBase rs.l 1
IconBase rs.l 1
DObject rs.l 1
Active rs.l 1
FirstSc rs.l 1
GraphicsBase rs.l 1
PublicScreen rs.l 1
PublicRastport rs.l 1
Gadget0 rs.l 1
Filter rs.l 1
VisualX rs.w 1
VisualY rs.w 1
TemplateArray rs.l 0 ;Do not change order!
TempMove rs.l 1
TempSFront rs.l 1
TempWFront rs.l 1
TempPDef rs.l 1
TempAlways rs.l 1
TempRemWin rs.l 1
TempMoveMouse rs.l 1
TempCXPOPUP rs.l 1
TempCXPRI rs.l 1
TempCXPOPKEY rs.l 1
TempHADJ rs.l 1
TempVADJ rs.l 1
TempScreen rs.l 1
TempWindow rs.l 1
TempDummy rs.l 1
TempZero rs.l 1
TempSave rs.l 1
OwnTask rs.l 1
Signal rs.l 1
Args rs.l 1
WBMessage rs.l 1
SignalMask rs.l 1
MyWindow rs.l 1
LastGadget rs.l 1
MyIORequest rs.l 1
MouseMsgPort rs.l 1
MyNewGadget rs.b gng_SIZEOF
MyInterrupt rs.b IS_SIZE
MyInputEvent rs.b ie_SIZEOF
PointerPixEvent rs.b IEPointerPixel_SIZEOF
EasyReqStruct rs.b es_SIZEOF
Description rs.b 64
ScreenPatternMem rs.b 512 ;sufficient I think
WindowPatternMem rs.b 512
AllocLength rs.w 1
intuition dc.b "intuition.library",0
DosName dc.b "dos.library",0
InputName dc.b "input.device",0
GraphicsName dc.b "graphics.library",0
IconName dc.b "icon.library",0
GadName dc.b "gadtools.library",0
CommName dc.b "commodities.library",0
even
MyNewBroker dc.b NB_VERSION ;Version
dc.b 0 ;Reserve1
dc.l HandlerName ;Name
dc.l PortName ;Title
dc.l DescText ;Description
dc.w NBU_NOTIFY!NBU_UNIQUE ;Unique
dc.w COF_SHOW_HIDE ;Flags
MyPri dc.b 0 ;Pri
dc.b 0 ;Reserve2
BrokerPort dc.l 0 ;Port
dc.w 0 ;ReservedChannel
CycleList dc.l GUI_Choose1.1,GUI_Choose1.2,GUI_Choose1.3,GUI_Choose1.4,0
CycleList2 dc.l GUI_Choose2.1,GUI_Choose2.2,GUI_Choose2.3,GUI_Choose2.4,0
rsreset
TemplateText rs.l 1
TemplateSpecial rs.l 1
TemplateA4 rs.w 1
TemplateType rs.w 1
TemplateSize rs.w 0
T_CHECK = 0
T_CYCLE = 1
T_STRING = 2
T_INTEGER = 3
NumberOfTemps = 13
WBTemplate dc.l TextDNW,0
dc.w TempDummy,T_CHECK
dc.l TextMove,0
dc.w TempMove,T_CHECK
dc.l TextSFront,0
dc.w TempSFront,T_CHECK
dc.l TextWFront,0
dc.w TempWFront,T_CHECK
dc.l TextPDef,0
dc.w TempPDef,T_CHECK
dc.l TextAlways,0
dc.w TempAlways,T_CHECK
dc.l TextRemWin,0
dc.w TempRemWin,T_CHECK
dc.l TextMoveMouse,0
dc.w TempMoveMouse,T_CHECK
dc.l TextCXPOPUP,0
dc.w TempCXPOPUP,T_CHECK
dc.l TextScreen,0
dc.w TempScreen,T_STRING
dc.l TextWindow,0
dc.w TempWindow,T_STRING
dc.l TextCXPOPKEY,0
dc.w TempCXPOPKEY,T_STRING
dc.l TextCXPRI,0
dc.w TempCXPRI,T_INTEGER
dc.l TextHADJ,CycleList
dc.w TempHADJ,T_CYCLE
dc.l TextVADJ,CycleList2
dc.w TempVADJ,T_CYCLE
dc.l 0
TextDNW dc.b "DONOTWAIT",0
TextMove dc.b "MOVE",0
TextSFront dc.b "SFRONT",0
TextWFront dc.b "WFRONT",0
TextPDef dc.b "DEFPUB",0
TextAlways dc.b "ALWAYS",0
TextCXPOPUP dc.b "CX_POPUP",0
TextCXPRI dc.b "CX_PRIORITY",0
TextCXPOPKEY dc.b "CX_POPKEY",0
TextRemWin dc.b "REMWIN",0
TextMoveMouse dc.b "MOVEMOUSE",0
TextHADJ dc.b "HADJ",0
TextVADJ dc.b "VADJ",0
TextScreen dc.b "SCREEN",0
TextWindow dc.b "WINDOW",0
Template dc.b "MOVE/S,SFRONT/S,WFRONT/S,DEFPUB/S,ALWAYS/S,REMWIN/S,MOVEMOUSE/S,CX_POPUP/S,CX_PRIORITY/K,CX_POPKEY/K,HADJ/K,VADJ/K,SCREEN/K,WINDOW/K",0
PortName dc.b "Huntwindows 2.7",0
HandlerName dc.b "Huntwindows",0
GadgetText dc.b "Ok",0
DefaultDescr dc.b "control alt h",0
AboutText dc.b "© by Jörg Bublath 1992-1993",$0a,"EMAIL:",$0a,"bublath@forwiss.uni-passau.de",0
HotKeyErrorT dc.b "Wrong hotkey description!",$0a,0
Text1 dc.b "Error in arguments or libraries!",$0a,0
Text2 dc.b "I need V37+ !",$0a,0
Text3 dc.b "Error in given patterns!",$0a,0
Text4 dc.b "Cannot Save!",$0a,0
dc.b "$VER: " ;for version information
Texth dc.b "Huntwindows 2.7 (26.4.93) by Jörg Bublath",0
DescText dc.b "Moves screen to show windows",0
GUI_Text1 dc.b "Move Screen",0
GUI_Text2 dc.b "ScreenToFront",0
GUI_Text3 dc.b "WindowToFront",0
GUI_Text5 dc.b "Set Default PubScreen",0
GUI_Text6 dc.b "Always",0
GUI_Text7 dc.b "Remember Window",0
GUI_Text7_1 dc.b "Move Mouse",0
GUI_Text7_2 dc.b "GUI Popup",0
GUI_Text8 dc.b "Horizontal Adjustment",0
GUI_Text9 dc.b "Vertical Adjustment",0
GUI_Text10 dc.b "_Hide",0
GUI_Text11 dc.b "_Quit",0
GUI_Text12 dc.b "Screen Pattern",0
GUI_Text13 dc.b "Window Pattern",0
GUI_Text14 dc.b "_Save",0
GUI_Text15 dc.b "_About",0
GUI_Text16 dc.b "Popup Hotkey",0
GUI_TextEnd ;
GUI_Choose1.1 dc.b "left",0
GUI_Choose1.2 dc.b "right",0
GUI_Choose1.3 dc.b "center",0
GUI_Choose1.4 dc.b "off",0
GUI_Choose2.1 dc.b "top",0
GUI_Choose2.2 dc.b "bottom",0
GUI_Choose2.3 dc.b "center",0
GUI_Choose2.4 dc.b "off",0
even